//
//  HelperListHeadView.swift
//  d11
//
//  Created by peale on 2019/1/25.
//  Copyright © 2019年 Tech_001. All rights reserved.
//

import UIKit

class HelperListHeadView: UICollectionReusableView {
    var bgView:UIView!
    var lineView:UIView!
    var titleLabel:UILabel!
    var lineXView:UIView!

    override init(frame: CGRect) {
        super.init(frame: frame)
         self.backgroundColor = HexRGBAlpha(0xf5f5f5, 1)
        self.bgView = UIView()
        self.bgView.backgroundColor = UIColor.white
         self.addSubview(self.bgView)
        self.bgView?.snp.makeConstraints{(make) in
            make.width.equalTo(self)
            make.height.equalTo(44)
            make.bottom.equalTo(0)
        }
        self.lineView = UIView()
        self.lineView.backgroundColor = HexRGBAlpha(0xffd46f, 1)
        self.lineView.layer.masksToBounds = true
        self.lineView.layer.cornerRadius = 1.5;
         self.bgView.addSubview(self.lineView)
        self.lineView?.snp.makeConstraints{(make) in
            make.width.equalTo(2)
            make.height.equalTo(20)
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(20)
        }
        self.titleLabel = UILabel()
        self.titleLabel.font = UIFont.systemFont(ofSize: 16)
        self.titleLabel.textAlignment = .left
        self.titleLabel.numberOfLines = 1
        self.titleLabel.textColor = HexRGBAlpha(0x575757, 1)
        self.bgView.addSubview(self.titleLabel)
        self.titleLabel?.snp.makeConstraints{(make) in
            make.width.equalTo(200)
            make.centerY.equalToSuperview()
            make.height.equalTo(30)
            make.left.equalTo(self.lineView.snp.right).offset(5)
            
        }
        
        self.lineXView = UIView()
        self.lineXView.backgroundColor = HexRGBAlpha(0xdddddd, 1)
        self.bgView.addSubview(self.lineXView)
        self.lineXView?.snp.makeConstraints{(make) in
            make.width.equalTo(self)
            make.height.equalTo(0.5)
            make.bottom.equalTo(self)
            
        }
       
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func setData(title :String) -> Void {
        self.titleLabel.text = title
    }
}
